﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime dt = DateTime.Now;
            Console.WriteLine("当前日期为{0}",dt);
            Console.WriteLine("这个月的第{0}天",dt.Day);
            Console.WriteLine("今天是",dt.DayOfWeek);
            Console.WriteLine("{0}",dt.Date);
            Console.WriteLine("今天是一年的第{0}天",dt.DayOfYear);
            Console.WriteLine("30天后{0}",dt.AddDays(30));
            Console.WriteLine("两年后{0}",dt.AddYears(2));
            Console.WriteLine("两小时后{0}",dt.AddHours(2));



            Console.WriteLine("输入字符：");
            string str = Console.ReadLine();
            Console.WriteLine("字符串的长度为：" + str.Length);
            Console.WriteLine("字符串中第一个字符为：" + str[0]);
            Console.WriteLine("字符串中最后一个字符为：" + str[str.Length - 1]);
        
    }
    }
}
